<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//最小值
			function min() {
				var a = Math.min(1,2,3,4);
				return a;
			}
			min();
			document.write("最小值为:" + min() + "<br />")
			
			
			//查找
			// function findNum(search,findobj){
			// 	for(var i=0;i<findobj.length;i++){
			// 		if(findobj[i] == search){
			// 			return true;
			// 		}
			// 	}
			// 	return false;
			// }
			// var s = "1234";
			// if(findNum("3",s)){
			// 	document.write("查找出3");
			// }
			
			var arr = [1,2,3,4];
			var select = 3;
			
			function s(a,b){
				var c;
				for (var i = 0; i < a.length; i++) {
					if(a[i]===b){
						return c=b;
						}
					}
				}
			s(arr,select);
			document.write(c);
			
			//排序
			function sortNumber(a,b)
			{
			return a - b
			}
			var arr = new Array(4)
			arr = [3,1,2,4];
			
			document.write("<br />"+arr.sort(sortNumber))
			
			
			//反转
			function fanzhuansort(c,d)
			{
			return d - c
			}
			var array = new Array(4)
			array = [4,3,2,1];
			
			document.write("<br />"+array.sort(fanzhuansort))
		</script>
	</body>
</html>
